#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>


int main()
{
    int arr[10] = { 0 };
    int n = 0;
    scanf("%d", &n);
    for (int i = 0; i < n; i++)
    {
        scanf("%d ", &arr[i]);
    }
    int m = 0;
    scanf("%d", &m);
    for (int i = 0; i < n; i++)
    {
        if (arr[i] != m)
            printf("%d ", arr[i]);
    }


    return 0;
}


